package hx.text;

import hx.mapper.EmployeeMapper;
import hx.pojo.Claim_voucher;
import hx.pojo.Employee;
import hx.service.EmployeeService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)         //将junit原有的运行器替换成spring提供的SpringJUnit4ClassRunner
@ContextConfiguration(locations = "classpath:spring.xml")   //获取spring路径
public class Text1 {

    @Autowired
    private EmployeeService employeeService;


    public void getPaperALL(){
        Employee name = employeeService.Login_name("张总");
        System.out.println(name.getPosition().getNameCN());
        System.out.println(name.getSN());
        System.out.println(name.getNAME());
        System.out.println(name.getPASSWORD());
        System.out.println(name.getSTATUS());
        System.out.println(name.getSTATUS());
    }

    //用于查询用户自己的报销凭证
    @Test
    public void clamin_Voucher(){
        List<Claim_voucher> claim_vouchers = employeeService.voucher_selectSN("003");
        for (Claim_voucher a:claim_vouchers){
            System.out.println(a.getCreateSN().getNAME());
        }
    }
}
